home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 436_01 / indemo.doc < prev    next >
Text File  |  1994-10-07  |  5KB  |  133 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.                         Using the Demonstration Program
  10.  
  11.  
  12.           INDEMO allows you to test INCON, the input control library.  It
  13.      demonstrates INCON's capabilities in two ways.  First, INDEMO itself
  14.      uses INCON to gather input into its own menu fields.  Second, it uses
  15.      the entries you make into those fields to set up a field customized to
  16.      your specifications, and allows you to make test entries into it.
  17.  
  18.           When you first run INDEMO, you'll be presented with a menu of all
  19.      INCON parameters and flags except the Debug flag.  You may navigate
  20.      through the menu using [Tab] and [Shift+Tab].  As you move into each
  21.      field, a short explanation of its purpose appears at the bottom of the
  22.      screen.  You must press [Enter] to register entries in parameter
  23.      fields because they are confirmed fields.  Flag fields are unconfirmed
  24.      so, once you've made a valid entry, INDEMO moves on to the next.  You
  25.      must, however, press [Enter] in the Template field to get to the entry
  26.      window.
  27.  
  28.           Entries for Fill and Pad must be the ASCII values of the
  29.      characters you want to use; when you press [Enter], INDEMO converts
  30.      them to their character representations.  ASCII 32 displays as " Sp"
  31.      (space), ASCII 255 as "PSp" (phantom space).  If you move back into
  32.      Fill or Pad, INDEMO converts the character back to its ASCII value.
  33.  
  34.           When you press [Enter] in the Template field, INDEMO creates a
  35.      field input window in the bottom third of the screen.  At the top of
  36.      the window INCON displays the input field you've set up.  The next
  37.      four lines display input field entries you make, up to the maximum
  38.      alpha field width of 255 characters; initially they show the default
  39.      input string.  Finally, INDEMO displays its Stat Box, showing
  40.      parameters in hexadecimal and flags in binary.
  41.  
  42.           During initialization of the test field, you'll see INCON's own
  43.      Stat Box flash on and off as INCON displays it just long enough to
  44.      capture it in memory.  Until you exit the initial field, you may use
  45.      [Numpad 5] to toggle INCON's Stat Box, which shows parameters and
  46.      flags as modified during initialization.  While INCON's Stat Box is
  47.      displayed, no entries into the input field are possible; you must
  48.      first turn it off with [Numpad 5].  INCON's Stat Box is identified by
  49.      name, and by having a double-line border; its video attribute is taken
  50.      from the field attribute.
  51.  
  52.           When you exit from the input field (in any of several ways
  53.      explained in INCON.DOC), INDEMO displays the vital statistics for your
  54.      entry.  First is the return value from INCON, followed by the overall
  55.      length of the input string, and finally the value of the string you
  56.      entered.  Non-template integer input is converted to signed long and
  57.      floating-point input to double; all other types are converted to
  58.      unsigned long.  INCON lets you create numeric fields and templates
  59.      that extend across an entire screen row, so input may be out of range
  60.      for the conversion routines in the standard library.
  61.  
  62.  
  63.  
  64.      Using the Demonstration Program                                 1
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.           Each time you leave the input field, INDEMO presents a "Quit this
  74.      test" prompt.  If you press [y], INDEMO then asks whether you wish to
  75.      quit all tests.  If you press any other key, you'll be placed back in
  76.      the input field with the default input string, if any, restored.  At
  77.      the "Quit all" prompt, press [y] to return to DOS; press any other key
  78.      to return to the INDEMO menu and continue experimenting with INCON.
  79.  
  80.           INDEMO illustrates how to use INCON's extended-key trapping to
  81.      provide special services to users.  The menu-navigation service using
  82.      [Tab] and [Shift+Tab] has been mentioned.  Another is a help screen
  83.      that pops up when you press [F1].  The help screen is available at any
  84.      time from within the INDEMO menu; to make it available while in the
  85.      field entry window, that is, while you're within INCON, you must set
  86.      the xKeys flag.
  87.  
  88.           The help routine is a creature of INDEMO; each time it is
  89.      displayed, INCON discards any input you've entered into the test
  90.      field.  That is in keeping with INCON's extended-key trapping, as
  91.      explained in INCON.DOC.  You could make the help routine part of INCON
  92.      itself, but that would require that INCON reserve yet another key, and
  93.      add more code to the library.  Or, you could alter INCON so that it
  94.      saved the state of the input field when it exited via any of the keys
  95.      in the extended-key list, but that would require careful handling of
  96.      INCON's internal buffers, all of which it now frees prior to exit.  In
  97.      addition, you'd need to save all of the state information for the
  98.      field, including the cursor position.
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.      Using the Demonstration Program                                 2
  131.  
  132.  
  133.